using System.ComponentModel;
using System;
namespace WpfApplication1
{
    partial class AddressDataContext
    {
        partial void InserttblAddress(tblAddress instance)
        {
            ExecuteDynamicInsert(instance);
        }
    }

    public class AddressIDChangingArgs : EventArgs
    {
        public int NewValue;

        public AddressIDChangingArgs(int newValue)
        {
            NewValue = newValue;
        }
    }

    public partial class tblAddress 
    {
        public EventHandler<AddressIDChangingArgs> AddressIDChanging;
        private static int _nextAddressID = 0;

        partial void OnAddressIDChanging(int value)
        {
            if (this.AddressIDChanging != null)
                this.AddressIDChanging(this, new AddressIDChangingArgs(value));
        }

        partial void OnCreated()
        {
            AddressID = --_nextAddressID;
            CountryID = 468;  // Set the country to the US.
        }
    }
}
